Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #7392: Error formatting for Ethereum DApp responses #7393

Merged
merged 1 commit into from
May 5, 2023

Conversation

StephenHeaps
Copy link
Contributor

@StephenHeaps StephenHeaps commented May 4, 2023

Summary of Changes

  • Similar to Solana, we need to strip the Error: prefix that Webkit applies when responding to a request or we lose the json formatting.

This pull request fixes #7392

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()
  • New or updated UI has been tested across:
    • Light & dark mode
    • Different size classes (iPhone, landscape, iPad)
    • Different dynamic type sizes

Test Plan:

  1. Visit Brave Talk with a Premium account
  2. Connect your wallet to Brave Talk
  3. Tap Host a Web3 Call
  4. Tap cancel on the signature request
  5. Verify error is displayed as Sign request cancelled instead of messy formatting (see issue).

If you have Brave Talk Premium, please verify the fix is working there.
This can also be verified using Ethereum Test DApp.

  1. Visit https://metamask.github.io/test-dapp/
  2. Connect your wallet to the test DApp
  3. Tap Sign under Personal Sign.
  4. Tap cancel on the signature request
  5. Verify Sign button now displays ERROR: THE USER REJECTED THE REQUEST
    • Previously: ERROR: ("CODE": 4001, 'MESSAGE": "THE USER REJECTED THE REQUEST.)

Screenshots:

brave.talk.error.formatting.mp4

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue and pull request is assigned to a milestone (should happen at merge time).

@StephenHeaps StephenHeaps requested a review from nuo-xu May 4, 2023 18:26
@StephenHeaps StephenHeaps self-assigned this May 4, 2023
@StephenHeaps StephenHeaps requested a review from a team as a code owner May 4, 2023 18:26
@StephenHeaps StephenHeaps added this to the 1.51 milestone May 4, 2023
@StephenHeaps StephenHeaps merged commit 318250d into development May 5, 2023
@StephenHeaps StephenHeaps deleted the wallet/ethereum-error-formatting branch May 5, 2023 13:20
StephenHeaps added a commit that referenced this pull request May 5, 2023
Fix error formatting for Ethereum DApp responses
arthuredelstein pushed a commit to brave/brave-core that referenced this pull request Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Ethereum DApp error response formatting
2 participants